﻿function MenuItemClick(e, grid) {
    switch (e.item.name) {
        case "btn_Insert":
            grid.AddNewRow();
            break;
        case "btn_edit":
            var index = grid.GetFocusedRowIndex();
            grid.StartEditRow(index);
            break;
        case "btn_Delete":
            if (confirm('Вы действительно хотите удалить запись?')) {
                var index = grid.GetFocusedRowIndex();
                grid.DeleteRow(index);
            }
            break;
        case "btn_column":
            if (grid.IsCustomizationWindowVisible())
                grid.HideCustomizationWindow();
            else
                grid.ShowCustomizationWindow();
            break;
    }
}